// This file is part of Indico.
// Copyright (C) 2002 - 2025 CERN
//
// Indico is free software; you can redistribute it and/or
// modify it under the terms of the MIT License; see the
// LICENSE file for more details.

@use 'base' as *;
@use './inputs' as *;

.dateField {
  display: inline-block;
  position: relative;

  img {
    cursor: pointer;
    float: right;
    padding: 2px;
    position: absolute;
    right: 2px;
  }

  input {
    width: 150px;
    padding-right: 20px;
  }
}

i.info-helper {
  @include icon-before('icon-question');
  @extend .text-superfluous;
  cursor: default;
}

.static-text-widget {
  word-wrap: break-word;
  width: 90%;

  & > p:first-child {
    margin-top: 0;
  }
}

.multiple-items-widget {
  .sort-handle {
    cursor: move;
    @include icon-before('icon-handle');
  }

  .ui-sortable-helper {
    display: table;
  }

  .thin-column {
    white-space: nowrap;
  }

  .multiline {
    white-space: pre-line;
  }

  textarea {
    width: 100%;
  }
}

.multiple-items-widget table,
.override-multiple-items-widget {
  input,
  select {
    width: 100% !important;
  }
}

.i-linking {
  width: 400px;
  min-height: 2.5em;

  > label {
    width: 28%;
  }

  > .i-linking-dropdown,
  > span.static-text {
    display: inline-block !important;
    width: 65% !important;
    padding: 0 !important;
  }

  > .i-linking-dropdown > select {
    width: 100%;
  }

  > input:checked + label {
    + .i-linking-dropdown,
    + span {
      @include dropdown-visible();
    }
  }

  > input:not(:checked) + label {
    + .i-linking-dropdown,
    + span {
      @include dropdown-hidden();
    }
  }
}

.text-holder-box {
  @include border-all($style: dashed);
  color: $light-black;
  min-height: 25px;
  min-width: 320px;
  margin-bottom: 10px;
  padding: 5px 10px;
}
